﻿using Preactor.ObjectModel.Attributes;
using Preactor.ObjectModel.Entities;
using Preactor.ObjectModel.Interfaces;

namespace Preactor.ObjectModel.BaseTypes
{
    public class Resource : PreactorRecord, IResource
    {
       [PreactorField("SEQ WINDOW", FieldDeclarationType.FieldClassification)]
       public string Name { get { return (string) GetValue("Name"); } set { SetValue("Name", value); } }

       public bool IsFinite {get { return Capacity == "Finite"; } }

       [PreactorField("SEQ BUCKET CAPACITY", FieldDeclarationType.FieldClassification)]
       public string Capacity { get { return (string) GetValue("Capacity"); } set { SetValue("Capacity", value); } }

       [PreactorField("SEQ MANNING", FieldDeclarationType.FieldClassification)]
       public double EfficiencyMultiplier { get { return (double)GetValue("EfficiencyMultiplier"); } set { SetValue("EfficiencyMultiplier", value); } }

       [PreactorField("SETUP MULTIPLIER", FieldDeclarationType.FieldClassification)]
       public double SetupEfficiencyMultiplier { get { return (double)GetValue("SetupEfficiencyMultiplier"); } set { SetValue("SetupEfficiencyMultiplier", value); } }

       public Resource(PrimaryKey id, PreactorObjectModel preactorObjectModel) : base(id, preactorObjectModel)
        {
        }

        public override string ToString()
        {
            return string.Format("Type: Resource, Format Name: {0}, PK: {1}", FormatName, Id.Value);
        }
    }
}
